package br.com.socket.functions;

import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

import br.com.socket.menu.Menu;

public class AcessDirectors {
	public static List<String> acessarDiretorio() {
		Process p = null;
		try {
			p = Runtime.getRuntime().exec(Menu.comando);
		} catch (IOException ex) {
			Logger.getLogger(ListProcess.class.getName()).log(Level.SEVERE,
					null, ex);
		}
		InputStream input = p.getInputStream();
		Scanner sc = new Scanner(input);

		List<String> processos = new LinkedList<String>();

		while (sc.hasNext()) {
			processos.add(sc.nextLine());
		}
		return processos;
	}
}
